package cn.ms.neural;

import cn.ms.neural.moduler.extension.gracestop.support.IGraceStopProcessor;

/**
 * 微服务神经元 <br>
 * 
 * 1.泛化引用、泛化实现、回声探测<br>
 * 2.链路追踪、容量规划、透明监控<br>
 * 3.优雅停机→黑白名单→流量浮动→流量控制→服务降级(?)→幂等保障→灰度路由→[超时控制→舱壁隔离→服务容错→慢性尝试]<br>
 * 
 * @author lry
 *
 * @param <REQ>
 * @param <RES>
 */
public class Neural<REQ, RES> extends NeuralFactory<REQ, RES>{

	public RES neural(REQ req, Object... args) {
		return moduler.getGraceStop().gracestop(req, new IGraceStopProcessor<REQ, RES>() {
			@Override
			public RES processor(REQ req, Object... args) {
				System.out.println("请求报文:"+req);
				return null;
			}
		}, args);
	}

}
